﻿@model WebUI.Models.ShotsViewModel
@{
    ViewBag.Title = "Shots";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<div><h2>Latest Shots</h2></div>
<div class="tabsbottom"></div>
<div class="clear"></div>

<div class="shotlist">
    @for (int i = 0; i < Model.LatestShotList.Count; i++)
    {
        int colCount = 4;
        var shot = Model.LatestShotList[i];
        var fullName = shot.FirstName + " " + shot.LastName;
        var divclass = string.Empty;
        var shotwrapperlastclass = string.Empty;
        if (i % colCount == colCount - 1)
        {
            divclass = "last";
            shotwrapperlastclass = "shotwrapperlast";
        }
        <div class="shotwrapper @shotwrapperlastclass">
            <div class="shot shot2 @divclass">
                <div class="innershot">
                    <div class="image">
                        <a href="/shots/@shot.ShotID" title="@shot.Title"><img src="@shot["ShotUrl"]" alt="@shot.Title"/></a>
                    </div>
                </div>
            </div>
            <div class="user">
                <a href="/user/@shot.UserName" rel="contact" title="@fullName"><img class="avatar16"  src="@shot["AvatarUrl"]" alt="@fullName"/>@fullName</a>
            </div>
        </div>
    }
</div>
<div class="minispacer"></div>
<div class="clear"></div>
<div class="page">
    <div class="paging">
    @if (Model.PreviousPage > 0)
    {
        <a href="@Url.Action("shots", new { Page = Model.PreviousPage })" class="action pagingaction" rel="prev">← Newer</a>
    }
    @if (Model.NextPage > 0)
    {
        <a href="@Url.Action("shots", new { Page = Model.NextPage })" class="action pagingaction" rel="next">Older →</a>
    }
    </div>
</div>
